package net.oschina.app.ui;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.EditText;

import net.oschina.app.R;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by Ethan on 2017/4/7.
 */
public class LoginActivity extends AppCompatActivity {
    @BindView(R.id.tb_news)
    Toolbar mTbNews;
    @BindView(R.id.et_login_username)
    EditText mEtLoginUsername;
    @BindView(R.id.et_login_pwd)
    EditText mEtLoginPwd;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        ButterKnife.bind(this);

        //设置Toolbar显示
        setSupportActionBar(mTbNews);

        //设置Toolbar显示导航键(返回键)
        getSupportActionBar().setHomeButtonEnabled(true);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);

        //设置Toolbar点击导航键返回,并销毁当前页面
        mTbNews.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}
